package com.ztesoft.huangfu.learning.springboot.springbootexception.exception;

import lombok.Data;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * Author: huangfu.daohui
 * Date: 2018/6/8
 * Time: 22:17
 * Version: 1.0
 * Description: 自定义异常
 **/
@Data
public class MyException extends RuntimeException implements Serializable {

    //RuntimeException中已经有了 message，此处直接继承即可
    private int code;

    public MyException(){
        super();
    }

    public MyException(int code, String message) {
        super(message);
        this.setCode(code);
    }

}
